#include <stdio.h>
#include <inttypes.h>
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h"
#include "cpu.h"
#include "hw/arm/stm32.h"

enum {
    STM32F1XX_PERIPH_UNDEFINED = -1,
    STM32F1XX_RCC = 0,
    STM32F1XX_GPIOA,
    STM32F1XX_GPIOB,
    STM32F1XX_GPIOC,
    STM32F1XX_GPIOD,
    STM32F1XX_GPIOE,
    STM32F1XX_GPIOF,
    STM32F1XX_GPIOG,
    STM32F1XX_GPIOH,
    STM32F1XX_GPIOI,
    STM32F1XX_GPIOJ,
    STM32F1XX_GPIOK,
    STM32F1XX_SYSCFG,
    STM32F1XX_AFIO,
    STM32F1XX_UART1,
    STM32F1XX_UART2,
    STM32F1XX_UART3,
    STM32F1XX_UART4,
    STM32F1XX_UART5,
    STM32F1XX_UART6,
    STM32F1XX_UART7,
    STM32F1XX_UART8,
    STM32F1XX_ADC1,
    STM32F1XX_ADC2,
    STM32F1XX_ADC3,
    STM32F1XX_DAC,
    STM32F1XX_TIM1,
    STM32F1XX_TIM2,
    STM32F1XX_TIM3,
    STM32F1XX_TIM4,
    STM32F1XX_TIM5,
    STM32F1XX_TIM6,
    STM32F1XX_TIM7,
    STM32F1XX_TIM8,
    STM32F1XX_BKP,
    STM32F1XX_PWR,
    STM32F1XX_I2C1,
    STM32F1XX_I2C2,
    STM32F1XX_I2S2,
    STM32F1XX_I2S3,
    STM32F1XX_WWDG,
    STM32F1XX_CAN1,
    STM32F1XX_CAN2,
    STM32F1XX_CAN,
    STM32F1XX_USB,
    STM32F1XX_SPI1,
    STM32F1XX_SPI2,
    STM32F1XX_SPI3,
    STM32F1XX_EXTI,
    STM32F1XX_SDIO,
    STM32F1XX_FSMC,
    STM32F1XX_PERIPH_COUNT,
};

const char *stm32f1xx_periph_name(stm32_periph_t periph);

#define STM32F1XX_GPIO_COUNT (STM32F1XX_GPIOG - STM32F1XX_GPIOA + 1)
